/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bsd5ex.group1.kaokang.dao;

import com.bsd5ex.group1.kaokang.config.TableNameConstants;
import com.bsd5ex.group1.kaokang.model.FoodPriceType;
import java.util.List;
import org.hibernate.Query;

/**
 *
 * @author IBIAINIKI
 */
public class FoodPriceTypeDAO extends AbstractDAO<FoodPriceType> {

    public FoodPriceType getFoodPriceTypeByID(int foodPriceTypeID) {
        return (FoodPriceType) queryOneResult("from " + getEntityName() + " as a where a.id_food_price_type=" + foodPriceTypeID);
    }

    public List getFoodPriceTypeByFoodID(int foodID) {
        return query("from " + getEntityName() + " as a where a.id_food=" + foodID);
    }
    
    public FoodPriceType getFoodPriceTypeByFoodIdAndTitle(int foodID, String title){
        return (FoodPriceType) queryOneResult("from " + getEntityName() + " as a where a.id_food=" + foodID + " AND a.food_price_type_name='"+title+"'");
    }
}
